package com.shop.cereshop.app.tencent.moderation.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 视频审核回调响应
 * 参考：https://cloud.tencent.com/document/product/1265/104001
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class VideoModerationCallbackResponse implements Serializable  {

    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     * 0：回调成功
     * 其他：回调失败
     */
    @JsonProperty("ErrorCode")
    private Integer errorCode;

    /**
     * 错误描述
     */
    @JsonProperty("ErrorMsg")
    private String errorMsg;

    /**
     * 创建成功的响应
     */
    public static VideoModerationCallbackResponse success() {
        VideoModerationCallbackResponse response = new VideoModerationCallbackResponse();
        response.setErrorCode(0);
        response.setErrorMsg("success");
        return response;
    }

    /**
     * 创建失败的响应
     */
    public static VideoModerationCallbackResponse fail(String errorMsg) {
        VideoModerationCallbackResponse response = new VideoModerationCallbackResponse();
        response.setErrorCode(1);
        response.setErrorMsg(errorMsg);
        return response;
    }

}
